home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / GraphicsWrap / Source / ListCell.m < prev    next >
Text File  |  1991-09-15  |  1KB  |  52 lines

  1. #import <dpsclient/psops.h>
  2. #import <appkit/graphics.h>
  3. #import <appkit/Font.h>
  4. #import <appkit/Text.h>
  5. #import <objc/hashtable.h>
  6. #import <objc/List.h>
  7. #import <string.h>
  8.  
  9. #import "ListCell.h"
  10.  
  11. extern free();
  12.  
  13. @implementation ListCell
  14. - init
  15. {
  16.   [super init];
  17.   controlDragEnabled=NO;
  18.   return self;
  19. }
  20.  
  21. - setFont:fontObj
  22. {
  23.     [super setFont:fontObj];
  24.     NXTextFontInfo(support, &ascender, &descender, &lineHeight);
  25.     return self;
  26. }    
  27.  
  28. - drawInside:(const NXRect *)cellFrame inView:controlView
  29. {
  30.   NXRect    rectArray[2];
  31.     
  32.   /* draw the two dark gray lines above and below the cell */
  33.     if (cFlags1.state || cFlags1.highlighted) {
  34.  
  35.     NXSetRect(&(rectArray[0]), NX_X(cellFrame), NX_Y(cellFrame),
  36.         NX_WIDTH(cellFrame), 1.0);
  37.     NXSetRect(&(rectArray[1]), NX_X(cellFrame), NX_MAXY(cellFrame) - 1.0,
  38.         NX_WIDTH(cellFrame), 1.0);
  39.  
  40.       /* using NXRectFillList is faster than separate calls to NXRectFill */
  41.     NXRectFillList(rectArray, 2);
  42.     }
  43.  
  44.     return self;
  45. }
  46.  
  47. - setControlDragEnabled:(BOOL) aBool
  48. { controlDragEnabled=aBool; return self; }
  49.   
  50. - (BOOL)controlDragEnabled { return controlDragEnabled; }
  51. @end
  52.